<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="telephone=no" name="format-detection" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>我的优惠券</title>
<link type="text/css" rel="stylesheet" href="css/index.css">
  <link rel="stylesheet" href="../shoppingmall/themes/css/home.css">
  <link rel="stylesheet" href="../shoppingmall/themes/css/icon.css">
  <script src="js/vue.js"></script>
  <script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<div id="el">
<div class="huiyuan_box color_1 fl">
  <div class="content">
    <div class="mp_renqi mp_renqi2">
      <div class=" mp_zzz_items bo_db"> <a href="JavaScript:;" class=" cur item">可用优惠券</a> </div>
      <ul>
        <li v-for="cu in cupon">
          <a href="javascript:" class="youhui ov_hd" v-if="cu.cupon_status==1" @click="selectliquanbao(cu.uc_id)">
            <div class="pic left_f" >
              <p class="da2">￥<span v-text="cu.cupon_money"></span></p>
              <p class="da3"><span v-text="cu.cupon_content"></span></p>
            </div>
            <div class="tiit right_f">
              <p class="da2"><span v-text="cu.cupon_name"></span></p>
              <p class="da3"><span v-text="cu.cupon_gettime"></span>
              &nbsp;&nbsp;
                拥有：<span v-text="cu.cupon_num"></span>张</p>

            </div>
          </a>
        </li>

      </ul>
    </div>
    
  </div>
  <div class="page"></div>
</div>
</div>
<footer class="aui-footer-default aui-footer-fixed">
  <a href="../shoppingmall/index.html" class="aui-footer-item ">
    <span class="aui-footer-item-icon aui-icon aui-footer-icon-home"></span>
    <span class="aui-footer-item-text">首页</span>
  </a>
  <a href="../shoppingmall/class.html" class="aui-footer-item aui-footer-active">
    <span class="aui-footer-item-icon aui-icon aui-footer-icon-class"></span>
    <span class="aui-footer-item-text">分类</span>
  </a>
  <a href="../shoppingmall/car.html" class="aui-footer-item">
    <span class="aui-footer-item-icon aui-icon aui-footer-icon-car"></span>
    <span class="aui-footer-item-text">购物车</span>
  </a>
  <a href="/weixin/queryIndex" class="aui-footer-item">
    <span class="aui-footer-item-icon aui-icon aui-footer-icon-me"></span>
    <span class="aui-footer-item-text">我的</span>
  </a>
</footer>
</div>


<script type="text/javascript">
  var a=new Vue({
    el:"#el",
    data:{
      cupon:[

      ]
    },
    created:function(){
      this.queryUserCupon2();
    },
    methods:{
      queryUserCupon2:function(){
        var _this=this;
        $.ajax({
          url:"/weixin/user/queryUserCupon2",
          data:{},
          dataType:"json",
          Type:"get",
          success:function (data) {
            // alert(data.li[0].cupon_name);
            for(var i = 0;i < data.li.length;i++){
              _this.cupon.push(data.li[i]);
            }
            // alert(_this.cupon[0].cupon_content);
            // alert(_this.cupon[1].cupon_content);
          }
        })
      },
      selectliquanbao:function(uc_id){
        //选中的优惠券,将id存储到session中，订单界面进行获取展示
        $.ajax({
          url:"/weixin/user/selectliquanbao",
          data:{"uc_id":uc_id},
          Type:"get",
          success:function (data) {
            location.href="../shoppingmall/order.html";
          }
        })
      },

    },

  })
</script>

</body></html>